package com.qzsoft.zhjd.server.modules.ludong.weigh.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 物料数据对象 n_materiel_data
 *
 * @author jk
 * @date 2021-09-09
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@TableName("n_materiel_data")
public class ReplenishRecordingEntity {
    private static final long serialVersionUID = 1L;

    /** $column.columnComment */
    @TableId(type = IdType.UUID)
    private String id;

    /** 基地主键 */
    private String organizationId;

    /** 地磅设备主键 */
    @NotBlank(message = "地磅id不能为空！")
    private String weighbridgeId;

    /** 物料类型主键 */
    private String materielTypeId;

    private String projectId;

//    @ApiModelProperty(value = "合同id",required = true)
//    @NotBlank(message = "合同id不能为空！")
    private String contractId;

    /** 计量单位 */
    private String company;

    /** 操作员主键 */
    private String operatorId;

    /** 合作单位主键（收料单位、发料单位） */
    private String cooperateUnitId;

    /** 磅单编号 */
    @NotBlank(message = "磅单编号不能为空！")
    private String weightCode;

    /** 过磅类型：0=收料，1=发料 */
    @NotNull(message = "过磅类型不能为空！")
    private String weightType;

    /** 数据类型（采购、销售等） */
    @NotBlank(message = "收料类型不能为空！")
    private String weightDataType;

    /** 数据来源：0=称重，1=补录 */
    private Integer weightDataSource;

    /** 偏差：0=正常，1=超负差，2=超正差 */
    private Integer deviationType;

    /** 毛重/t */
    @NotNull(message = "毛重不能为空！")
    private BigDecimal grossWeight;

    /** 皮重/t */
    @NotNull(message = "皮重不能为空！")
    private BigDecimal tareWeight;

    /** 扣重占比 */
    @NotNull(message = "扣重占比不能为空！")
    private BigDecimal deductionRatio;

    /** 扣重/t */
    private BigDecimal deductionWeight;

    /** 净重/t */
    private BigDecimal netWeight;

    /** 实际重量 */
    private BigDecimal weight;

    private BigDecimal prince;

    private BigDecimal totalPrince;

    /** 实际数量 */
    private BigDecimal quantity;

    /** 运单编号 */
    @NotBlank(message = "运单编号不能为空！")
    private String waybillCode;

    /** 运单重量/t */
    @NotNull(message = "运单重量不能为空！")
    private BigDecimal waybillWeight;

    /** 运单数量 */
    private BigDecimal waybillQuantity;

    /** 运单图片 */
    private String waybillImage;

    /** 进磅时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "称毛时间不能为空！")
    private LocalDateTime entryTime;

    /** 出磅时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "称皮时间不能为空！")
    private LocalDateTime exitTime;

    /** 车牌号 */
    @NotBlank(message = "车牌号不能为空！")
    private String carNumber;

    private String deptId;

    private String deptPkid;

    /** 进磅图片1 */
    private String entryImageOne;

    /** 进磅图片2 */
    private String entryImageTwo;

    /** 进磅图片3 */
    private String entryImageThree;

    /** 进磅图片4 */
    private String entryImageFour;

    /** 出磅图片1 */
    private String exitImageOne;

    /** 出磅图片2 */
    private String exitImageTwo;

    /** 出磅图片3 */
    private String exitImageThree;

    /** 出磅图片4 */
    private String exitImageFour;

    /** 是否废弃：0=否，1=是 */
    private Integer disable;

    /** 入库时间 */
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Date createDate;

    /** 是否删除 0已删除 1未删除 */
    @TableLogic
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private String deleted;

    /**
     * 超出差值状态
     */
    private int deviationTypeStatus;

    private String usgae;

   @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private long creator;

    @TableField(fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NEVER)
    private long updater;

    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(fill = FieldFill.INSERT_UPDATE, updateStrategy = FieldStrategy.NEVER)
    private Date updateDate;

   /**
     * 备注信息
     */
    private String remark;

}
